﻿using System;
using UnityEngine;
using UnityEngine.EventSystems;

namespace UniRx.Triggers
{
	// Token: 0x0200042E RID: 1070
	[DisallowMultipleComponent]
	public class ObservableDragTrigger : ObservableTriggerBase, IEventSystemHandler, IDragHandler
	{
		// Token: 0x0600165B RID: 5723 RVA: 0x000616E7 File Offset: 0x0005FAE7
		void IDragHandler.OnDrag(PointerEventData eventData)
		{
			if (this.onDrag != null)
			{
				this.onDrag.OnNext(eventData);
			}
		}

		// Token: 0x0600165C RID: 5724 RVA: 0x00061700 File Offset: 0x0005FB00
		public IObservable<PointerEventData> OnDragAsObservable()
		{
			Subject<PointerEventData> result;
			if ((result = this.onDrag) == null)
			{
				result = (this.onDrag = new Subject<PointerEventData>());
			}
			return result;
		}

		// Token: 0x0600165D RID: 5725 RVA: 0x00061728 File Offset: 0x0005FB28
		protected override void RaiseOnCompletedOnDestroy()
		{
			if (this.onDrag != null)
			{
				this.onDrag.OnCompleted();
			}
		}

		// Token: 0x04000C97 RID: 3223
		private Subject<PointerEventData> onDrag;
	}
}
